﻿@model sipfe.model.dataAccess.SIPMaeEmpresa
@using Resources;
@using sipfe.util;
@{    
    string show = ViewBag.nIdeEmpresaCSM;
}
<script type="text/javascript">
    $(function () {
        calendarioFechaNac('dfecFunda');
        setAutoAyudaCompendioDetalle("#vActivPrin", "#nIdeActPrin", 17, "/AutoAyuda/ListaDetCompendioAuto");
        setAutoAyudaCompendioDetalle("#vActivSecun", "#nIdeActSec", 17, "/AutoAyuda/ListaDetCompendioAuto");
        inicioPopPupModal("#divPopupJQ", 250, 680, "LISTADO DE ACTIVIDADES DE LA EMPRESA");
    });
</script>
<script type="text/javascript" src="@Url.Content(@properties.mantePersonaJS)"></script>
@if (string.IsNullOrEmpty(show))
{
using (Html.BeginForm("regDatosEmpresaInp", "ManteEmpresa", FormMethod.Post))
{
    @Html.ValidationSummary(false, "Los Siguientes Campos son Obligatorios:")
    @Html.HiddenFor(model => model.nIdeUsuReg, new { Value = @Session[Constante.N_IDE_USUARIO]})
    @Html.HiddenFor(model => model.dtFecReg, new { Value =@DateTime.Now.ToString()})
    @Html.HiddenFor(model => model.dFecIniVig, new { Value =@DateTime.Now.ToString()})
    @Html.HiddenFor(model => model.nIdeActPrin)
    @Html.HiddenFor(model => model.nIdeActSec)   
   <input id="swReg" name="swReg" value="@ViewBag.swReg" type="hidden" />
    <fieldset style="width: 650px;">
    <legend><span>Registrar Nueva Persona Juridica</span></legend>
    <table>
        <tbody>
            <tr>                
                <td>
                    <table>                    
                        <tr>
                            <td>País Emisor<span class="asterisco">(*)</span></td>
                            <td>Tipo documento<span class="asterisco">(*)</span></td>
                            <td>Número documento<span class="asterisco">(*)</span></td>
                        </tr>                   
                        <tr>
                            <td>@Html.DropDownListFor(model => model.nIdeCodPaisDoc, (IEnumerable<SelectListItem>)ViewBag.PaisEmisor, "--Seleccione--")</td>
                            <td>@Html.DropDownListFor(model => model.nIdeTipoDocum, (IEnumerable<SelectListItem>)ViewBag.TipoDocIdent, "--Seleccione--")</td>
                            <td>@Html.TextBoxFor(model => model.vNumDocum, new { @class = "textBoxMay", style = "width:80px;text-transform:none;", maxlength = 20, onkeypress = "return validaAlfaNumTamanio(this,event,20);", onblur = "javascript:onBlurUpper(this); javascript:validaDocumentoPersona(this,'2','2','#nIdeTipoDocum','#nIdeCodPaisDoc');" })</td>
                        </tr>
                        <tr>
                            <td colspan="3">Nombre o Razón Social  <span class="asterisco">(*)</span></td>
                        </tr>
                        <tr>
                            <td colspan="3">@Html.TextBoxFor(model => model.vRazonSocial, new { style = "width:650px;", maxlength = 200, onblur = "javascript:onBlurUpper(this);" })</td>
                            
                        </tr>
                        <tr>
                            <td colspan="3">Actividad principal</td>
                        </tr>
                        <tr>
                            <td colspan="3">
                                @Html.TextBox("vActivPrin", null, new { style = "width:630px;", maxlength = 120 })
                                <img src="@Url.Content("~/images/buscar.gif")" class="lupita2" alt="BUSCAR ACTIVIDAD" onclick="javascript:listarActividad('#divPopupJQ','#vActivPrin','#nIdeActPrin');" />
                            </td>                           
                        </tr>
                        <tr>
                            <td colspan="3">Actividad secundaria</td>
                        </tr>
                        <tr>
                           <td colspan="3">
                               @Html.TextBox("vActivSecun", null, new { style = "width:630px;", maxlength = 120 })
                               <img src="@Url.Content("~/images/buscar.gif")" class="lupita2" alt="BUSCAR ACTIVIDAD" onclick="javascript:listarActividad('#divPopupJQ','#vActivSecun','#nIdeActSec');" />
                           </td>                            
                        </tr>
                        <tr><td>Fecha de fundación</td><td>Cantidad Trabajadores</td><td>Cuenta bancaria</td></tr>
                        <tr>
                            <td>@Html.TextBoxFor(model => model.dfecFunda, new { style = "width:60px;text-transform:none;", maxlength = 10})</td>
                            <td>@Html.TextBoxFor(model => model.nNumTrabaja, new { @class = "textBoxMay", style = "width:50px;text-transform:none;", maxlength = 6,  onkeypress = "return validarSoloNumeros(event);", onpaste = "return false;"})</td>
                            <td>@Html.TextBoxFor(model => model.vCuentaBanco, new { @class = "textBoxMay", style = "width:200px;text-transform:none;", maxlength = 50, onkeypress = "return validaAlfaNumTamanio(this,event,50);", onpaste = "return false;"})</td>    
                        </tr>
                    </table>
                </td>
            </tr>
        </tbody>
    </table>
</fieldset>
    <table>
        <tr>
            <td><b>Campo Obligatorio:</b>&nbsp;<span class="asterisco">(*)</span></td>
            <td><input type="button" value="Registrar" onclick="javascript: addEmpresaPopFinal(this.form);" /></td>
            <td><img src="@Url.Content("~/images/sunat.jpg")" class="lupita3" alt="SUNAT" onclick="javascript:consultaSunat();" /></td>
        </tr>
    </table>
}
}else{    
 <div>@RenderPage("../../Shared/RODatosEmpresa.cshtml")</div>
}